package dtaskboard.server.dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public final class EMFactory {

  private static EntityManager em;

  public static synchronized EntityManager get() {
    if (EMFactory.em == null) {
      EntityManagerFactory emf =
          Persistence.createEntityManagerFactory("taskborg");
      EMFactory.em = emf.createEntityManager();

    }
    return EMFactory.em;
  }

}
